﻿using System;
using System.Data;
using System.Linq;
using Model;

namespace BLL
{
    public class ELMAH_Error_BLL
    {
        ExtendedDBModelContainer _db = new ExtendedDBModelContainer();

        public IQueryable<ELMAH_Error> Get()
        {
            return _db.ELMAH_Error.OrderByDescending(a => a.TimeUtc);
        }

        public ELMAH_Error Get(Guid? Id)
        {
            var item = new ELMAH_Error();

            if (Id != null)
            {
                item = _db.ELMAH_Error.Single(a => a.ErrorId.Equals(Id.Value));
            }
            return item;
        }
       
    }
}
